<template>
<div class="a">
  <div  v-for="i in feedss"
        :key="i.id" class="video-item"
>
    <div class="videoplayer" >
      <!-- <video
      
        is="true"
        webkit-playsinline="true"
        playsinline="true"
        x-webkit-airplay="deny"
     
       
        preload="none"
        muted="true"
      ></video> -->
      <img
        class="img noneBg poster"
        :alt="`${i.shareInfo.title}`"
        :src="`${i.shareInfo.img}`"
        e="0"
        c="0"
      />
      <div class="video-title">
        {{ i.title }}
      </div>
      <div class="play-but"
      
                  @click="
                    $router.push({
                      path: '/play',
                      query: {
                        url: i.video.url,
                        img: i.user.avatarurl,
                        count: i.title,
                        nickName: i.user.nickName,
                        background: i.shareInfo.img,
                      },
                    })
                  "
      >

      </div>
      <div class="info-bar"><div class="time">{{ i.onlineTime | timer }}</div></div>
    </div>
    <div class="video-info">
      <div>
        <img class="img noneBg user-avatar" :src="`${i.user.avatarurl}`" />
        <div class="user-nickname">{{ i.user.nickName }}</div>
      </div>
      <div>
          <!-- 点赞 -->
        <div
          class="video-praise"
        >
          {{i.upCount}}
        </div>
        <div
          class="video-comment"
        >
          {{i.commentCount}}
        </div>
        <div
          class="video-share"
        >
        </div>
      </div>
    </div>
  </div>
</div>
</template>

<script>
export default {
 
  data:function(){
  return{
feedss:[],

  };
},
//  methods:{
//         toMov(id) {
//           console.log(id);
//             this.$router.push("/play/"+id );
//         }
//     },
created:function(){
 this.axios
      .get("https://apis.netstart.cn/maoyan/video/0")
      .then((res) => {
        console.log(res, this);
        this.feedss = res.data.data.feeds;
        console.log(this.feedss);
      });




},
};
</script>

<style lang="less">
.a{

margin-top:156px;
.video-item {
    margin-bottom: 6px;
    position: relative;

    .videoplayer {
    position: relative;
    height: 211px;
    overflow: hidden;
    background-color: #000;
    video {
    width: 100%;
    height: 100%;
    background-color: #000;
    object-fit: cover;
                            }
    .poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: none;
}
.img{
    border:0;
    display: inline-block;
}
 .video-title {
    position: absolute;
    top: 0;
    left: 0;
    font-family: PingFangSC-Medium,serif;
    font-size: 17px;
    color: #fff;
    letter-spacing: 0;
    line-height: 24px;
    z-index: 1;
    margin: 9px 15px 19px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-all;
    overflow: hidden;
}
.play-but {
    z-index: 10;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    margin-left: -29px;
    margin-top: -29px;
    background-image: url("../assets/video-play.png");
    background-size: contain;
}
.info-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    height: 30px;
    line-height: 30px;
    background: linear-gradient(180deg,transparent,rgba(0,0,0,.5));
    color: #fff;
    font-size: 12px;
    .time {
    float: right;
    margin-right: 10px;
}
}

                                }

      .video-info {
    height: 46px;
    background-color: #fff;
    padding-left: 15px;
    display: flex;
    justify-content: space-between;
    .user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 11px;
    background: none;
    border: 0;
    display: inline-block;
}
    .user-nickname {
    margin-left: 8px;
    font-size:14px;
    color: #666;
}
.video-praise {
    background: url("../assets/video-praise.png") no-repeat 0;
    background-size: 18px 18px;
    padding-left: 23px;
    padding-right: 5px;
    font-size: 12px;
    height: 35px;
    line-height: 35px;
    margin-right: 26.5px;
}
.video-comment {
    background: url("../assets/video-comment.png") no-repeat 0;
    background-size: 18px 18px;
    padding-left: 23px;
    padding-right: 5px;
    font-size: 12px;
    color: #666;
    height: 35px;
    line-height: 35px;
    margin-right: 12px;
}
.video-share {
    background: url("../assets/video-share.png") no-repeat 50%;
    background-size: 18px 18px;
    width: 18px;
    height: 35px;
    padding-left: 7.5px;
    padding-right: 7.5px;
    margin-right: 7.5px;
}
}    
.video-info>div {
    height: 100%;
    display: flex;
    align-items: center;
}          

                                }
}
</style>